package com.shihb.structuralpatterns.compositepattern;/**
 *Description:
 *Version:1.0.0
 *@author shihb
 *@date 2020/7/19 22:02
 */
public class Client {

  public static void main(String[] args) {
    Organization myUniversity = new University("安徽财经大学");

    Organization college1 = new College("财经学院");
    Organization college2 = new College("计算机学院");

    Department department1 = new Department("金融系");
    Department department2 = new Department("会计系");
    Department department3 = new Department("软件工程");
    Department department4 = new Department("计算机科学");

    college1.add(department1);
    college1.add(department2);
    college2.add(department3);
    college2.add(department4);

    myUniversity.add(college1);
    myUniversity.add(college2);


    // 部分和整体

    myUniversity.show();
    System.out.println("+++++++++++++++++++++++++");
    college1.show();






  }
}
